<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>uCXpresso.BLE: ble_serial.h Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../upnp.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">uCXpresso.BLE
   &#160;<span id="projectnumber">v1.0.4</span>
   </div>
   <div id="projectbrief">RTOS C++ Framework for Bluetooth Low Energy</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../modules.html"><span>Modules</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('dd/d5c/ble__serial_8h_source.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">ble_serial.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> ===============================================================================</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> Name        : ble_serial.h</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> Author      : uCXpresso</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> Version     : 1.0.14</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> Date        : 2014/4/10</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> Copyright   : Copyright (C) www.embeda.com.tw</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> Description : UART (Serial Stream) service for BLE</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> ===============================================================================</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> History</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> ---------+---------+--------------------------------------------+-------------</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> DATE     | VERSION |   DESCRIPTIONS                             |  By</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> ---------+---------+--------------------------------------------+-------------</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> 2014/1/1   v1.0.0  Initialize                                          Jason</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> 2014/1/4   v1.0.1  Add onAckTimeout() event for ACK timeout.           Jason</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> 2014/1/18  v1.0.2  Rename to bleSerial Class                           Jason</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> 2014/1/19  v1.0.3  Add onAlert / onLinkLose / setTxPowerLevel          Jason</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> 2014/1/20  v1.0.4  Modify ble engine process for RTOS                  Jason</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> 2014/1/22  v1.0.5  Add parameter &#39;stack&#39; for enable() member           Jason</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">                    Add available() member to UART service check.</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> 2014/2/05  v1.0.6  Add isReadyForNotify() member for notify service.</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> 2014/2/11  v1.0.7  Add setup() member function.                        Jason</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> 2014/2/18  v1.0.8  Add m_semDataCredit semaphore.                      Jason</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> 2014/2/21  v1.0.9  Add connInterval &amp; connTimeout parameters in        Jason</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment">                    setup() member function.</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> 2014/2/24  v1.0.10 Rename setup() to advertising()                     Jason</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> 2014/3/2   v1.0.11 Add onError event to indicate an error occurred.    Jason</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment">                    Move setTxPowerLevel member to bleProximity class.</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> 2014/3/8   v1.0.12 Rename member onLoseLink to onLinkLoss              Jason</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment">                    Rename member onHrControl to onHeartRateControl</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment"> 2014/3/15  v1.0.13 Change BLE polling to interrupt method.             Jason</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment"> 2014/4/10  v1.0.14 Remove isActived() member for power save features.  Jason</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment"> ===============================================================================</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#ifndef BLE_SERIAL_H</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define BLE_SERIAL_H</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;class/stream.h&quot;</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &quot;class/thread.h&quot;</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#include &quot;class/spi.h&quot;</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &quot;class/pin.h&quot;</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &quot;class/semaphore.h&quot;</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#include &quot;class/mutex.h&quot;</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#include &quot;class/timeout.h&quot;</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">#define BLE_RESPONSE_TIMEOUT    3000</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DEF_BLE_DEVICENAME      &quot;uCXpresso.BLE&quot;</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DEF_BLE_ADV_INTERVAL    500     // default advertising intervel 500ms</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DEF_BLE_TXPOWER         -65     // default tx power level -65dbm @ 1M</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DEF_BLE_NOTIFY_TIMEOUT  3000</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DEF_BLE_DATA_TIMEOUT    1500</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DEF_BLE_CONN_INTERVAL   10      // default connection interval 10ms</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DEF_BLE_CONN_TIMEOUT    1000    // default connection timeout 3sec</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define DEF_BLE_MFG_DATA        0x1234</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#gafdc7d73c1364c4d42f80cfdc702de294">   65</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#ggafdc7d73c1364c4d42f80cfdc702de294a3aaba90cbef710f140a4f7e70d1f0d5b">   66</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#ggafdc7d73c1364c4d42f80cfdc702de294a3aaba90cbef710f140a4f7e70d1f0d5b">BLE_TERMINATED</a> =1,      </div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#ggafdc7d73c1364c4d42f80cfdc702de294a0951f45ff7c03c7b46d1f96332c8fc27">   67</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#ggafdc7d73c1364c4d42f80cfdc702de294a0951f45ff7c03c7b46d1f96332c8fc27">BLE_UNACCEPTABLE</a> = 2    </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;} <a class="code" href="../../db/dff/group___enumerations.html#gafdc7d73c1364c4d42f80cfdc702de294">BLE_DISCONNECT_REASON_T</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#ga3b6d6db9e13e93ae21f2a383d9903617">   73</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a5c98a88cfa9a664b8d96aa6a03ba53d9">   74</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a5c98a88cfa9a664b8d96aa6a03ba53d9">BLE_TX_m18dBm</a>   = 0,    </div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a3bb453927e41ed489d5783eb01a432b6">   75</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a3bb453927e41ed489d5783eb01a432b6">BLE_TX_m12dBm</a>   = 1,    </div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a1db610898779c31e5fe4b7cda75c8b4e">   76</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a1db610898779c31e5fe4b7cda75c8b4e">BLE_TX_m6dBm</a>    = 2,    </div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a657bee3a9a945c511d573971038ccd54">   77</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a657bee3a9a945c511d573971038ccd54">BLE_TX_0dBm</a>     = 3     </div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;}<a class="code" href="../../db/dff/group___enumerations.html#ga3b6d6db9e13e93ae21f2a383d9903617">BLE_TX_POWER_T</a>;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#ga6c00522f6a8c33135ee0414877d42c04">   83</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04a4b3ee10917919fa72598e8c8a0131342">   84</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04a4b3ee10917919fa72598e8c8a0131342">BLE_ERR_OK</a>  = 0,</div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04aaa0c52ac5b1905e8035c78aeed3d1db4">   85</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04aaa0c52ac5b1905e8035c78aeed3d1db4">BLE_ERR_HW</a>,             </div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04a54530870fb2878254b47f1e0650456ef">   86</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04a54530870fb2878254b47f1e0650456ef">BLE_ERR_BUF</a>,            </div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04aaa3bd3b90312f5e85fc132b5d4a1a62a">   87</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04aaa3bd3b90312f5e85fc132b5d4a1a62a">BLE_ERR_ACK_TIMEOUT</a>,    </div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04a1cf05a76d9f21338d5297bbc4bcbc355">   88</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04a1cf05a76d9f21338d5297bbc4bcbc355">BLE_ERR_RSP_TIMEOUT</a>,    </div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04ac08af44027b924f6026dac945b00cbac">   89</a></span>&#160;    <a class="code" href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04ac08af44027b924f6026dac945b00cbac">BLE_ERR_DAT_TIMEOUT</a>     </div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;}<a class="code" href="../../db/dff/group___enumerations.html#ga6c00522f6a8c33135ee0414877d42c04">BLE_ERR_T</a>;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="../../d7/d03/classble_serial.html">   99</a></span>&#160;<span class="keyword">class </span><a class="code" href="../../d7/d03/classble_serial.html">bleSerial</a>: <span class="keyword">public</span> <a class="code" href="../../d4/d16/class_c_stream.html">CStream</a>, <span class="keyword">public</span> <a class="code" href="../../d0/d26/class_c_thread.html">CThread</a> {</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <a class="code" href="../../d7/d03/classble_serial.html#a835c884c9209b074cf82e5a3f0a322ec">bleSerial</a>(LPCTSTR deviceName=DEF_BLE_DEVICENAME);</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="../../d7/d03/classble_serial.html#a0ee4ea2d6d4a38bbd64968336f85c2e9">advertising</a>(uint16_t advInterval,</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;               int8_t txPowerLevel=DEF_BLE_TXPOWER,</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;               uint16_t connInterval=DEF_BLE_CONN_INTERVAL,</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;               uint16_t connTimeout=DEF_BLE_CONN_TIMEOUT,</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;               uint16_t manufactureData=DEF_BLE_MFG_DATA);</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="../../d7/d03/classble_serial.html#acc1e214474c9e98705fb7f363a3eee74">  136</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="../../d7/d03/classble_serial.html#acc1e214474c9e98705fb7f363a3eee74">setup</a>(uint16_t advInterval,</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;               int8_t txPowerLevel=DEF_BLE_TXPOWER,</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;               uint16_t connInterval=DEF_BLE_CONN_INTERVAL,</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;               uint16_t connTimeout=DEF_BLE_CONN_TIMEOUT,</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;               uint16_t manufactureData=DEF_BLE_MFG_DATA) {</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;        <a class="code" href="../../d7/d03/classble_serial.html#a0ee4ea2d6d4a38bbd64968336f85c2e9">advertising</a>(advInterval, txPowerLevel, connInterval, connTimeout, manufactureData);</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    }</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="comment">// Controls</span></div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<span class="preprocessor"></span>    <span class="keywordtype">bool</span> <a class="code" href="../../d7/d03/classble_serial.html#a3ff1e4b271a7d225e73abd337043d8e4">enable</a>(uint32_t stack=190);</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="preprocessor"></span>    <span class="keywordtype">bool</span> <a class="code" href="../../d7/d03/classble_serial.html#a3ff1e4b271a7d225e73abd337043d8e4">enable</a>(uint32_t stack=128);</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="../../d7/d03/classble_serial.html#a08b3a82e95aa527433c04b4a6a3d81d4">disable</a>();</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="../../d7/d03/classble_serial.html#a2588b21bf80d35a866dc7e47f97142df">watchdog</a>(uint32_t tm);     <span class="comment">// The WD timeout will reset the BLE core automatically when APP crash to cause the BLE core lock,</span></div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="comment">// PHY Function</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;<span class="comment"></span>    <span class="keywordtype">bool</span>    <a class="code" href="../../d7/d03/classble_serial.html#a5e63823fd7ff0ef0ac5447cd265b5a5c">disconnect</a>(<a class="code" href="../../db/dff/group___enumerations.html#gafdc7d73c1364c4d42f80cfdc702de294">BLE_DISCONNECT_REASON_T</a> reason=<a class="code" href="../../db/dff/group___enumerations.html#ggafdc7d73c1364c4d42f80cfdc702de294a3aaba90cbef710f140a4f7e70d1f0d5b">BLE_TERMINATED</a>);</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    <span class="keywordtype">bool</span>    <a class="code" href="../../d7/d03/classble_serial.html#acddad359ad714bd31358c96966839a61">setRadioTxPower</a>(<a class="code" href="../../db/dff/group___enumerations.html#ga3b6d6db9e13e93ae21f2a383d9903617">BLE_TX_POWER_T</a> power);</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    uint8_t <a class="code" href="../../d7/d03/classble_serial.html#a6aea16b265aa98f0a540f71b75965408">getPhyVersion</a>();</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    <span class="comment">// Events</span></div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../d7/d03/classble_serial.html#adb930ce55295ff7eb6ab5bdbeb702749">onConnected</a>();</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../d7/d03/classble_serial.html#aa6f5116c8bcf05011a05ad5e2967c318">onDisconnected</a>();</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../d7/d03/classble_serial.html#a8af315789cc459a1fde96ac80ca9ffb7">onWatchdog</a>();</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div>
<div class="line"><a name="l00249"></a><span class="lineno"><a class="line" href="../../d7/d03/classble_serial.html#a8a0622f5d10fe2242978a16b2d1e6ee4">  249</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../d7/d03/classble_serial.html#a8a0622f5d10fe2242978a16b2d1e6ee4">onError</a>(<a class="code" href="../../db/dff/group___enumerations.html#ga6c00522f6a8c33135ee0414877d42c04">BLE_ERR_T</a> err, LPCTSTR <span class="keywordtype">id</span>=<span class="stringliteral">&quot;bleSerial&quot;</span>){}   <span class="comment">// onError() Event indicate the error code when an error occurred.</span></div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    <span class="comment">// for BLE UART Service</span></div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    <span class="comment">// Implement the virtual functions of CStream class</span></div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;</div>
<div class="line"><a name="l00261"></a><span class="lineno"><a class="line" href="../../d7/d03/classble_serial.html#a1691c5c5655043512bf1c462e6928488">  261</a></span>&#160;    <span class="keyword">inline</span>  <span class="keywordtype">bool</span> <a class="code" href="../../d7/d03/classble_serial.html#a1691c5c5655043512bf1c462e6928488">isAvailable</a>() { <span class="keywordflow">return</span> <a class="code" href="../../d7/d03/classble_serial.html#ac42a8f805e6784e0fa2064270b5288a1">writeable</a>(); }</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    <span class="comment">// Implement the virtual functions from CStream class</span></div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span>  <a class="code" href="../../d7/d03/classble_serial.html#a59dca8e3e2d6945a699347f4c4708fd4">readable</a>();</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span>  <a class="code" href="../../d7/d03/classble_serial.html#ac42a8f805e6784e0fa2064270b5288a1">writeable</a>();</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span>  <a class="code" href="../../d4/d16/class_c_stream.html#af56764abe8954430eede10e253f8994f">read</a>(<span class="keywordtype">void</span> *buf, <span class="keywordtype">int</span> len, <span class="keywordtype">bool</span> block=<span class="keyword">true</span>);</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span>  <a class="code" href="../../d7/d03/classble_serial.html#ab9d147e7dcb9436f390f2ad29d539930">write</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *buf, <span class="keywordtype">int</span> len, <span class="keywordtype">bool</span> block=<span class="keyword">true</span>);</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="../../d7/d03/classble_serial.html#aebfde0d9a7583cb641ac60f02df7cd77">isConnected</a>();</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../d7/d03/classble_serial.html#ad41b78cc1b0fc02ce65248147b32ffa8">flush</a>();</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    <span class="comment">// PRIVATE, internal used</span></div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;<span class="comment"></span>    <span class="keyword">virtual</span> ~<a class="code" href="../../d7/d03/classble_serial.html">bleSerial</a>();</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;            <span class="keywordtype">void</span> reset();</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> onResponseCommandHook(<span class="keywordtype">void</span> *data);</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> onTransactionFinishedHook();</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> onDataCreditHook();</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> onBleRecv(uint8_t *buf, <span class="keywordtype">int</span> len);</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> onBleSend(uint8_t ack);</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> onAckTimeout();</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> isReadyForNotify();</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    LPCTSTR  m_deviceName;</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    uint16_t m_advInterval;</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    uint16_t m_conInterval;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    uint16_t m_conTimeout;</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    uint16_t m_mfgData;</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    int8_t   m_txPowerLevel;</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> onAlert(uint8_t level);</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> onLinkLoss(uint8_t level);</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> onHeartRateControl(uint8_t ctrl);</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    <span class="comment">// Implement the virtual function of CThread class</span></div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../d0/d26/class_c_thread.html#a071c3d3b3c19a7bd6a01aca073a9b4d7">run</a>();</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    <a class="code" href="../../d3/d0d/class_c_mutex.html">CMutex</a>          m_mxSender;</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;    <a class="code" href="../../d0/d06/class_c_semaphore.html">CSemaphore</a>      m_semResponse;</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;    <a class="code" href="../../d0/d06/class_c_semaphore.html">CSemaphore</a>      m_semTransaction;</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    <a class="code" href="../../d0/d06/class_c_semaphore.html">CSemaphore</a>      m_semDataCredit;</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;    xHandle         m_event;</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    <a class="code" href="../../d5/d5b/class_c_timeout.html">CTimeout</a>    m_tmACK;</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;    uint32_t    m_tmWatch;</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;    <span class="comment">// Friend Classes</span></div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;<span class="preprocessor">#include &quot;class/ble_battery.h&quot;</span></div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;<span class="preprocessor">#include &quot;class/ble_ht.h&quot;</span></div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;<span class="preprocessor">#include &quot;class/ble_proximity.h&quot;</span></div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;<span class="preprocessor">#include &quot;class/ble_heartrate.h&quot;</span></div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;<span class="preprocessor">#include &quot;class/ble_devinfo.h&quot;</span></div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;<span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="../../d8/d3b/classble_battery_level.html">bleBatteryLevel</a>;</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;<span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="../../d9/d26/classble_health_thermometer.html">bleHealthThermometer</a>;</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;<span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="../../de/d67/classble_proximity.html">bleProximity</a>;</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;<span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="../../d3/d81/classble_heart_rate.html">bleHeartRate</a>;</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;<span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="../../d3/dc5/classble_device_info.html">bleDeviceInfo</a>;</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    <span class="keyword">class </span><a class="code" href="../../de/d67/classble_proximity.html">bleProximity</a>  *m_proximity;</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;    <span class="keyword">class </span><a class="code" href="../../d3/d81/classble_heart_rate.html">bleHeartRate</a>  *m_heartrate;</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;<span class="preprocessor">#undef BLE_BATTERY_H_</span></div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#undef BLE_HT_H_</span></div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#undef BLE_PROXIMITY_H_</span></div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#undef BLE_HEARTRATE_H_</span></div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#undef BLE_DEVINFO_H_</span></div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;};</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;<span class="keyword">extern</span> <a class="code" href="../../d7/d03/classble_serial.html">bleSerial</a> *objBLE;</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* BLE_SERIAL_H */</span><span class="preprocessor"></span></div>
<div class="ttc" id="classble_battery_level_html"><div class="ttname"><a href="../../d8/d3b/classble_battery_level.html">bleBatteryLevel</a></div><div class="ttdef"><b>Definition:</b> ble_battery.h:32</div></div>
<div class="ttc" id="group___enumerations_html_ga6c00522f6a8c33135ee0414877d42c04"><div class="ttname"><a href="../../db/dff/group___enumerations.html#ga6c00522f6a8c33135ee0414877d42c04">BLE_ERR_T</a></div><div class="ttdeci">BLE_ERR_T</div><div class="ttdef"><b>Definition:</b> ble_serial.h:83</div></div>
<div class="ttc" id="group___enumerations_html_gga3b6d6db9e13e93ae21f2a383d9903617a1db610898779c31e5fe4b7cda75c8b4e"><div class="ttname"><a href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a1db610898779c31e5fe4b7cda75c8b4e">BLE_TX_m6dBm</a></div><div class="ttdoc">-6dBm </div><div class="ttdef"><b>Definition:</b> ble_serial.h:76</div></div>
<div class="ttc" id="class_c_semaphore_html"><div class="ttname"><a href="../../d0/d06/class_c_semaphore.html">CSemaphore</a></div><div class="ttdef"><b>Definition:</b> semaphore.h:33</div></div>
<div class="ttc" id="class_c_stream_html"><div class="ttname"><a href="../../d4/d16/class_c_stream.html">CStream</a></div><div class="ttdef"><b>Definition:</b> stream.h:27</div></div>
<div class="ttc" id="group___enumerations_html_gga3b6d6db9e13e93ae21f2a383d9903617a3bb453927e41ed489d5783eb01a432b6"><div class="ttname"><a href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a3bb453927e41ed489d5783eb01a432b6">BLE_TX_m12dBm</a></div><div class="ttdoc">-12dBm </div><div class="ttdef"><b>Definition:</b> ble_serial.h:75</div></div>
<div class="ttc" id="group___enumerations_html_ga3b6d6db9e13e93ae21f2a383d9903617"><div class="ttname"><a href="../../db/dff/group___enumerations.html#ga3b6d6db9e13e93ae21f2a383d9903617">BLE_TX_POWER_T</a></div><div class="ttdeci">BLE_TX_POWER_T</div><div class="ttdef"><b>Definition:</b> ble_serial.h:73</div></div>
<div class="ttc" id="classble_serial_html_a08b3a82e95aa527433c04b4a6a3d81d4"><div class="ttname"><a href="../../d7/d03/classble_serial.html#a08b3a82e95aa527433c04b4a6a3d81d4">bleSerial::disable</a></div><div class="ttdeci">void disable()</div></div>
<div class="ttc" id="classble_serial_html_a3ff1e4b271a7d225e73abd337043d8e4"><div class="ttname"><a href="../../d7/d03/classble_serial.html#a3ff1e4b271a7d225e73abd337043d8e4">bleSerial::enable</a></div><div class="ttdeci">bool enable(uint32_t stack=128)</div></div>
<div class="ttc" id="classble_serial_html_a1691c5c5655043512bf1c462e6928488"><div class="ttname"><a href="../../d7/d03/classble_serial.html#a1691c5c5655043512bf1c462e6928488">bleSerial::isAvailable</a></div><div class="ttdeci">bool isAvailable()</div><div class="ttdef"><b>Definition:</b> ble_serial.h:261</div></div>
<div class="ttc" id="group___enumerations_html_gga3b6d6db9e13e93ae21f2a383d9903617a5c98a88cfa9a664b8d96aa6a03ba53d9"><div class="ttname"><a href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a5c98a88cfa9a664b8d96aa6a03ba53d9">BLE_TX_m18dBm</a></div><div class="ttdoc">-18dBm (Low) </div><div class="ttdef"><b>Definition:</b> ble_serial.h:74</div></div>
<div class="ttc" id="group___enumerations_html_ggafdc7d73c1364c4d42f80cfdc702de294a3aaba90cbef710f140a4f7e70d1f0d5b"><div class="ttname"><a href="../../db/dff/group___enumerations.html#ggafdc7d73c1364c4d42f80cfdc702de294a3aaba90cbef710f140a4f7e70d1f0d5b">BLE_TERMINATED</a></div><div class="ttdoc">Request termination of the connection with the peer device with the reason &quot;Remote user terminated co...</div><div class="ttdef"><b>Definition:</b> ble_serial.h:66</div></div>
<div class="ttc" id="classble_proximity_html"><div class="ttname"><a href="../../de/d67/classble_proximity.html">bleProximity</a></div><div class="ttdef"><b>Definition:</b> ble_proximity.h:34</div></div>
<div class="ttc" id="classble_serial_html_aa6f5116c8bcf05011a05ad5e2967c318"><div class="ttname"><a href="../../d7/d03/classble_serial.html#aa6f5116c8bcf05011a05ad5e2967c318">bleSerial::onDisconnected</a></div><div class="ttdeci">virtual void onDisconnected()</div></div>
<div class="ttc" id="group___enumerations_html_gga6c00522f6a8c33135ee0414877d42c04a1cf05a76d9f21338d5297bbc4bcbc355"><div class="ttname"><a href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04a1cf05a76d9f21338d5297bbc4bcbc355">BLE_ERR_RSP_TIMEOUT</a></div><div class="ttdoc">Response timeout. </div><div class="ttdef"><b>Definition:</b> ble_serial.h:88</div></div>
<div class="ttc" id="class_c_thread_html"><div class="ttname"><a href="../../d0/d26/class_c_thread.html">CThread</a></div><div class="ttdef"><b>Definition:</b> thread.h:64</div></div>
<div class="ttc" id="classble_serial_html_ab9d147e7dcb9436f390f2ad29d539930"><div class="ttname"><a href="../../d7/d03/classble_serial.html#ab9d147e7dcb9436f390f2ad29d539930">bleSerial::write</a></div><div class="ttdeci">virtual int write(const void *buf, int len, bool block=true)</div></div>
<div class="ttc" id="group___enumerations_html_gga6c00522f6a8c33135ee0414877d42c04aaa3bd3b90312f5e85fc132b5d4a1a62a"><div class="ttname"><a href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04aaa3bd3b90312f5e85fc132b5d4a1a62a">BLE_ERR_ACK_TIMEOUT</a></div><div class="ttdoc">ACK timeout. </div><div class="ttdef"><b>Definition:</b> ble_serial.h:87</div></div>
<div class="ttc" id="group___enumerations_html_gga3b6d6db9e13e93ae21f2a383d9903617a657bee3a9a945c511d573971038ccd54"><div class="ttname"><a href="../../db/dff/group___enumerations.html#gga3b6d6db9e13e93ae21f2a383d9903617a657bee3a9a945c511d573971038ccd54">BLE_TX_0dBm</a></div><div class="ttdoc">0dBm (High) </div><div class="ttdef"><b>Definition:</b> ble_serial.h:77</div></div>
<div class="ttc" id="classble_serial_html_a835c884c9209b074cf82e5a3f0a322ec"><div class="ttname"><a href="../../d7/d03/classble_serial.html#a835c884c9209b074cf82e5a3f0a322ec">bleSerial::bleSerial</a></div><div class="ttdeci">bleSerial(LPCTSTR deviceName=DEF_BLE_DEVICENAME)</div><div class="ttdoc">bleSerial constructor with a GAT device name. </div></div>
<div class="ttc" id="classble_serial_html_ac42a8f805e6784e0fa2064270b5288a1"><div class="ttname"><a href="../../d7/d03/classble_serial.html#ac42a8f805e6784e0fa2064270b5288a1">bleSerial::writeable</a></div><div class="ttdeci">virtual int writeable()</div></div>
<div class="ttc" id="classble_heart_rate_html"><div class="ttname"><a href="../../d3/d81/classble_heart_rate.html">bleHeartRate</a></div><div class="ttdef"><b>Definition:</b> ble_heartrate.h:60</div></div>
<div class="ttc" id="classble_serial_html_a59dca8e3e2d6945a699347f4c4708fd4"><div class="ttname"><a href="../../d7/d03/classble_serial.html#a59dca8e3e2d6945a699347f4c4708fd4">bleSerial::readable</a></div><div class="ttdeci">virtual int readable()</div></div>
<div class="ttc" id="classble_serial_html_adb930ce55295ff7eb6ab5bdbeb702749"><div class="ttname"><a href="../../d7/d03/classble_serial.html#adb930ce55295ff7eb6ab5bdbeb702749">bleSerial::onConnected</a></div><div class="ttdeci">virtual void onConnected()</div></div>
<div class="ttc" id="class_c_thread_html_a071c3d3b3c19a7bd6a01aca073a9b4d7"><div class="ttname"><a href="../../d0/d26/class_c_thread.html#a071c3d3b3c19a7bd6a01aca073a9b4d7">CThread::run</a></div><div class="ttdeci">virtual void run()</div></div>
<div class="ttc" id="classble_serial_html_aebfde0d9a7583cb641ac60f02df7cd77"><div class="ttname"><a href="../../d7/d03/classble_serial.html#aebfde0d9a7583cb641ac60f02df7cd77">bleSerial::isConnected</a></div><div class="ttdeci">virtual bool isConnected()</div></div>
<div class="ttc" id="class_c_timeout_html"><div class="ttname"><a href="../../d5/d5b/class_c_timeout.html">CTimeout</a></div><div class="ttdef"><b>Definition:</b> timeout.h:22</div></div>
<div class="ttc" id="classble_serial_html_ad41b78cc1b0fc02ce65248147b32ffa8"><div class="ttname"><a href="../../d7/d03/classble_serial.html#ad41b78cc1b0fc02ce65248147b32ffa8">bleSerial::flush</a></div><div class="ttdeci">virtual void flush()</div></div>
<div class="ttc" id="classble_serial_html_a8af315789cc459a1fde96ac80ca9ffb7"><div class="ttname"><a href="../../d7/d03/classble_serial.html#a8af315789cc459a1fde96ac80ca9ffb7">bleSerial::onWatchdog</a></div><div class="ttdeci">virtual void onWatchdog()</div></div>
<div class="ttc" id="classble_serial_html_a8a0622f5d10fe2242978a16b2d1e6ee4"><div class="ttname"><a href="../../d7/d03/classble_serial.html#a8a0622f5d10fe2242978a16b2d1e6ee4">bleSerial::onError</a></div><div class="ttdeci">virtual void onError(BLE_ERR_T err, LPCTSTR id=&quot;bleSerial&quot;)</div><div class="ttdef"><b>Definition:</b> ble_serial.h:249</div></div>
<div class="ttc" id="class_c_mutex_html"><div class="ttname"><a href="../../d3/d0d/class_c_mutex.html">CMutex</a></div><div class="ttdef"><b>Definition:</b> mutex.h:31</div></div>
<div class="ttc" id="classble_serial_html_a0ee4ea2d6d4a38bbd64968336f85c2e9"><div class="ttname"><a href="../../d7/d03/classble_serial.html#a0ee4ea2d6d4a38bbd64968336f85c2e9">bleSerial::advertising</a></div><div class="ttdeci">void advertising(uint16_t advInterval, int8_t txPowerLevel=DEF_BLE_TXPOWER, uint16_t connInterval=DEF_BLE_CONN_INTERVAL, uint16_t connTimeout=DEF_BLE_CONN_TIMEOUT, uint16_t manufactureData=DEF_BLE_MFG_DATA)</div></div>
<div class="ttc" id="classble_serial_html_a5e63823fd7ff0ef0ac5447cd265b5a5c"><div class="ttname"><a href="../../d7/d03/classble_serial.html#a5e63823fd7ff0ef0ac5447cd265b5a5c">bleSerial::disconnect</a></div><div class="ttdeci">bool disconnect(BLE_DISCONNECT_REASON_T reason=BLE_TERMINATED)</div></div>
<div class="ttc" id="class_c_stream_html_af56764abe8954430eede10e253f8994f"><div class="ttname"><a href="../../d4/d16/class_c_stream.html#af56764abe8954430eede10e253f8994f">CStream::read</a></div><div class="ttdeci">virtual uint8_t read()</div></div>
<div class="ttc" id="classble_serial_html_acc1e214474c9e98705fb7f363a3eee74"><div class="ttname"><a href="../../d7/d03/classble_serial.html#acc1e214474c9e98705fb7f363a3eee74">bleSerial::setup</a></div><div class="ttdeci">void setup(uint16_t advInterval, int8_t txPowerLevel=DEF_BLE_TXPOWER, uint16_t connInterval=DEF_BLE_CONN_INTERVAL, uint16_t connTimeout=DEF_BLE_CONN_TIMEOUT, uint16_t manufactureData=DEF_BLE_MFG_DATA)</div><div class="ttdef"><b>Definition:</b> ble_serial.h:136</div></div>
<div class="ttc" id="classble_serial_html"><div class="ttname"><a href="../../d7/d03/classble_serial.html">bleSerial</a></div><div class="ttdoc">bleSerial class is a ble core, and inherits from CStream class to provide the stream virtual function...</div><div class="ttdef"><b>Definition:</b> ble_serial.h:99</div></div>
<div class="ttc" id="classble_health_thermometer_html"><div class="ttname"><a href="../../d9/d26/classble_health_thermometer.html">bleHealthThermometer</a></div><div class="ttdef"><b>Definition:</b> ble_ht.h:60</div></div>
<div class="ttc" id="classble_device_info_html"><div class="ttname"><a href="../../d3/dc5/classble_device_info.html">bleDeviceInfo</a></div><div class="ttdef"><b>Definition:</b> ble_devinfo.h:45</div></div>
<div class="ttc" id="classble_serial_html_a2588b21bf80d35a866dc7e47f97142df"><div class="ttname"><a href="../../d7/d03/classble_serial.html#a2588b21bf80d35a866dc7e47f97142df">bleSerial::watchdog</a></div><div class="ttdeci">void watchdog(uint32_t tm)</div></div>
<div class="ttc" id="group___enumerations_html_gga6c00522f6a8c33135ee0414877d42c04a4b3ee10917919fa72598e8c8a0131342"><div class="ttname"><a href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04a4b3ee10917919fa72598e8c8a0131342">BLE_ERR_OK</a></div><div class="ttdef"><b>Definition:</b> ble_serial.h:84</div></div>
<div class="ttc" id="group___enumerations_html_ggafdc7d73c1364c4d42f80cfdc702de294a0951f45ff7c03c7b46d1f96332c8fc27"><div class="ttname"><a href="../../db/dff/group___enumerations.html#ggafdc7d73c1364c4d42f80cfdc702de294a0951f45ff7c03c7b46d1f96332c8fc27">BLE_UNACCEPTABLE</a></div><div class="ttdoc">Request termination of the link with the peer device with the reason &quot;Unacceptable connection timing&quot;...</div><div class="ttdef"><b>Definition:</b> ble_serial.h:67</div></div>
<div class="ttc" id="group___enumerations_html_gga6c00522f6a8c33135ee0414877d42c04aaa0c52ac5b1905e8035c78aeed3d1db4"><div class="ttname"><a href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04aaa0c52ac5b1905e8035c78aeed3d1db4">BLE_ERR_HW</a></div><div class="ttdoc">Hardware Error. </div><div class="ttdef"><b>Definition:</b> ble_serial.h:85</div></div>
<div class="ttc" id="classble_serial_html_a6aea16b265aa98f0a540f71b75965408"><div class="ttname"><a href="../../d7/d03/classble_serial.html#a6aea16b265aa98f0a540f71b75965408">bleSerial::getPhyVersion</a></div><div class="ttdeci">uint8_t getPhyVersion()</div></div>
<div class="ttc" id="group___enumerations_html_gga6c00522f6a8c33135ee0414877d42c04ac08af44027b924f6026dac945b00cbac"><div class="ttname"><a href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04ac08af44027b924f6026dac945b00cbac">BLE_ERR_DAT_TIMEOUT</a></div><div class="ttdoc">Core data timeout. </div><div class="ttdef"><b>Definition:</b> ble_serial.h:89</div></div>
<div class="ttc" id="classble_serial_html_acddad359ad714bd31358c96966839a61"><div class="ttname"><a href="../../d7/d03/classble_serial.html#acddad359ad714bd31358c96966839a61">bleSerial::setRadioTxPower</a></div><div class="ttdeci">bool setRadioTxPower(BLE_TX_POWER_T power)</div></div>
<div class="ttc" id="group___enumerations_html_gafdc7d73c1364c4d42f80cfdc702de294"><div class="ttname"><a href="../../db/dff/group___enumerations.html#gafdc7d73c1364c4d42f80cfdc702de294">BLE_DISCONNECT_REASON_T</a></div><div class="ttdeci">BLE_DISCONNECT_REASON_T</div><div class="ttdef"><b>Definition:</b> ble_serial.h:65</div></div>
<div class="ttc" id="group___enumerations_html_gga6c00522f6a8c33135ee0414877d42c04a54530870fb2878254b47f1e0650456ef"><div class="ttname"><a href="../../db/dff/group___enumerations.html#gga6c00522f6a8c33135ee0414877d42c04a54530870fb2878254b47f1e0650456ef">BLE_ERR_BUF</a></div><div class="ttdoc">Sender queue buffer was full. </div><div class="ttdef"><b>Definition:</b> ble_serial.h:86</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_d9ab3e09413249e340719d1c246acc66.html">Jason Project</a></li><li class="navelem"><a class="el" href="../../dir_e60b0d0338763df7a227cbecf5ac6106.html">Firmware</a></li><li class="navelem"><a class="el" href="../../dir_c8ef7bdfc8622ceb56fdbfff8f44a6b4.html">lpcxpresso</a></li><li class="navelem"><a class="el" href="../../dir_bc2544560b94a5512f672a61310393b1.html">ucxpresso.lite</a></li><li class="navelem"><a class="el" href="../../dir_89b485e3174b4ad30c1cd4b50a79dec9.html">uCXpresso.BLE</a></li><li class="navelem"><a class="el" href="../../dir_ef35519cefd621f663612ebad34cbfc9.html">inc</a></li><li class="navelem"><a class="el" href="../../dir_23b8956a4518e3beec6402c1bb795b19.html">class</a></li><li class="navelem"><b>ble_serial.h</b></li>
    <li class="footer">Generated on Fri Apr 11 2014 23:43:26 for uCXpresso.BLE by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
